package com.ktjy.springredis.controller;

import com.ktjy.springredis.entity.Student;
import com.ktjy.springredis.service.StudentService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @return 13141
 * 2025/7/23
 * 15:45
 */
@RestController
public class StudentController {
    @Resource
    private StudentService studentService;

    @RequestMapping("/student/insert")
    public boolean insert() {
        return studentService.insert(new Student("1", "小明"));
    }

    @RequestMapping("/student/update")
    public boolean update() {
        return studentService.update(new Student("1", "蔡徐坤"));
    }

    @RequestMapping("/student/delete")
    public boolean delete() {
        return studentService.delete("1");
    }

    @RequestMapping("/student/get")
    public Object get() {
        return studentService.get("1");
    }
}
